{% extends 'base.html' %}
{% block title %}
    个人信息
{% endblock %}

{% block content %}
    <div class="layui-form layui-tab-content login_register" id="LAY_ucm" style="padding: 20px 30%;">
    <div class="layui-tab-item layui-show login_shadow">
        <form class="layui-form layui-form-pane" action="" method="post">
            <div class="layui-form-item" style="padding: 0% 30%"> <div class="layui-form-mid layui-word-aux info_set">{{ success_message }}</div></div>
             <div class="layui-form-item">
             <label for="username" class="layui-form-label info_set">用户名</label>
                <div class="layui-input-inline">
                  <input type="text" id="username" name="username" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">{{ username_error }}</div>
             </div>

             <div class="layui-form-item">
                 <label for="province" class="layui-form-label info_set">省份</label>
                 <div class="layui-input-inline">
                 <select class="layui-select" style="width: fit-content" name="province" id="province" lay-filter="brickType">
                     <option value="11">北京市</option>
                     <option value="12">天津市</option>
                     <option value="13">河北省</option>
                     <option value="14">山西省</option>
                     <option value="15">内蒙古自治区</option>
                     <option value="21">辽宁省</option>
                     <option value="22">吉林省</option>
                     <option value="23">黑龙江省</option>
                     <option value="31">上海市</option>
                     <option value="32">江苏省</option>
                     <option value="33">浙江省</option>
                     <option value="34">安徽省</option>
                     <option value="35">福建省</option>
                     <option value="36">江西省</option>
                     <option value="37">山东省</option>
                     <option value="41">河南省</option>
                     <option value="42">湖北省</option>
                     <option value="43">湖南省</option>
                     <option value="44">广东省</option>
                     <option value="45">广西壮族自治区</option>
                     <option value="46">海南省</option>
                     <option value="50">重庆市</option>
                     <option value="51">四川省</option>
                     <option value="52">贵州省</option>
                     <option value="53">云南省</option>
                     <option value="54">西藏自治区</option>
                     <option value="61">陕西省</option>
                     <option value="62">甘肃省</option>
                     <option value="63">青海省</option>
                     <option value="64">宁夏回族自治区</option>
                     <option value="65">新疆维吾尔自治区</option>
{#                     <option value="71">台湾省</option>#}
                     <option value="81">香港特别行政区</option>
                     <option value="82">澳门特别行政区</option>
                 </select>
             </div>
             </div>

              <div class="layui-form-item">
                 <label for="subject_type" class="layui-form-label info_set">类别</label>
                 <div class="layui-input-inline">
                 <select class="layui-select" style="width: fit-content" name="subject_type" id="subject_type">
                     <option value="1">理科</option>
                     <option value="2">文科</option>
                     <option value="3">综合</option>
                 </select>
                 <div class="layui-form-mid layui-word-aux">{{ subject_type_error }}</div>
             </div>
             </div>

              <div class="layui-form-item">
                  <label for="score" class="layui-form-label info_set">分数</label>
                  <div class="layui-input-inline">
                  <input type="number" min="0" max="800" id="score" name="score" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">{{ score_error }}</div>
             </div>

            <div class="layui-form-item" style="padding: 20px 30%;"><button class="layui-btn info_button">提交</button></div>
        </form>
    </div>
    </div>

<script>
layui.use(['form'], function() {
        var form=layui.form;
        $("#username").val({{ user.username }});
        $("#score").val({{ user.score }});
        var select = 'dd[lay-value=' + {{ user.province.province_id }} + ']';
        $('#province').siblings("div.layui-form-select").find('dl').find(select).click();
        var select = 'dd[lay-value=' + {{ user.subject_type }} + ']';
        $('#subject_type').siblings("div.layui-form-select").find('dl').find(select).click();
        form.on('select(brickType)', function(data){   
        var val=data.value;
        console.info(val);
        if(val==31 || val==33){
            console.info('333');



        }
                       });
        });
</script>
{% endblock %}